package com.meet.bizservice.impl;

import com.meet.exception.BusinessException;
import com.meet.bizservice.TagService;
import com.meet.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

@Service
public class TagServiceImpl implements TagService {

    private static final Logger logger = LoggerFactory.getLogger(TagServiceImpl.class);

    @Override
    public Result<List<String>> getUserInterestTags() {
        try {
            logger.info("Getting user interest tags");

            // 这里应该从JWT中获取用户ID，为简化演示直接返回示例数据
            return Result.success(Arrays.asList("音乐", "电影", "旅游"));
        } catch (Exception e) {
            logger.error("Error getting user interest tags", e);
            throw new BusinessException("获取用户兴趣标签失败");
        }
    }

    @Override
    public Result<Boolean> updateInterestTags(List<String> interestTags) {
        try {
            logger.info("Updating user interest tags");

            // 这里应该从JWT中获取用户ID，为简化演示直接返回成功
            return Result.success(true);
        } catch (Exception e) {
            logger.error("Error updating user interest tags", e);
            throw new BusinessException("更新用户兴趣标签失败");
        }
    }
}
